<template>
    <div class="permissionsControl">
        权限管理判断页
    </div>
</template>
<script>
    export default {
        data(){
            return{
                huasan:{      
                    manager:{kcgl_add:false,kcgl_edit:false,kcgl_del:false,kcgl_comment:false,kcgl_delAll:false,kcgl_export:false},//课程管理
                    tuijian:{kctj_add:false,kctj_cancel:false,kctj_cancelAll:false,kctj_export:false},//课程推荐
                    banner:{sygdt_add:false,sygdt_edit:false,sygdt_del:false},//首页滚动图
                    news:{xwzx_add:false,xwzx_edit:false,xwzx_del:false,xwzx_comment:false,xwzx_delAll:false,xwzx_export:false},//新闻资讯
                    lecture:{hdjz_add:false,hdjz_edit:false,hdjz_del:false,hdjz_delAll:false,hdjz_seen:false,hdjz_release:false,hdjz_bmgl:false,hdjz_export:false},//活动讲座
                    lectureRecommend:{hdjztj_recommend:false,hdjztj_cancel:false,hdjztj_export:false},//活动讲座推荐
                    column:{lmgl_add:false,lmgl_edit:false,lmgl_del:false,lmgl_switch:false,lmgl_updown:false},//栏目管理
					courseTaskManager:{kcrw_add:false,kcrw_release:false,kcrw_edit:false,kcrw_delAll:false,kcrw_del:false,kcrw_export:false,kcrw_seen:false},//课程任务
                    teacher:{jsgl_add:false,jsgl_import:false,jsgl_edit:false,jsgl_del:false,jsgl_delAll:false,jsgl_export:false},//讲师管理


					userManager:{yhgl_add:false,yhgl_edit:false,yhgl_del:false,yhgl_operationAll:false,yhgl_switch:false,yhgl_operationData:false},//用户管理
					
					enterprise:{qygl_add:false,qygl_export:false,qygl_edit:false,qygl_del:false,qygl_delAll:false},//企业管理
					audit:{ygsh_pass:false,ygsh_fail:false,ygsh_export:false},//员工审核
					
					goods:{spgl_add:false,spgl_edit:false,spgl_del:false,spgl_delAll:false,spgl_export:false},//商品管理
					goodRecommend:{tjgl_recommend:false,tjgl_cancel:false,tjgl_export:false},//推荐管理
					exchange:{dhjl_seen:false,dhjl_del:false,dhjl_delivery:false,dhjl_logistics:false,dhjl_self:false,dhjl_export:false},//兑换记录
					setAdmin:{glyqx_add:false,glyqx_switch:false,glyqx_edit:false,glyqx_reset:false,glyqx_del:false},//管理员权限
					rank:{phb_kc:false,phb_js:false,phb_xy:false},//排行榜  
					detail:{xfmx_export:false},//学分明细
					rule:{xfgz_edit:false},//学分规则
					grade:{xydj_add:false,xydj_edit:false,xydj_del:false,xydj_switch:false},//学员等级
					about:{gywm_save:false,gywm_cancel:false},//关于我们
					fankui:{yjfk_del:false,yjfk_delAll:false,yjfk_export:false},//意见反馈
					version:{bbgl_add:false,bbgl_edit:false,bbgl_del:false,bbgl_release:false,bbgl_seen:false,bbgl_export:false},//版本管理
					xieyi:{yhxy_save:false,yhxy_cancel:false},//用户协议
					zhengce:{yszc_save:false,yszc_cancel:false},//隐私政策
					tiaokuan:{fwtk_save:false,fwtk_cancel:false},//服务条款
					imgGuanli:{tpgl_add:false,tpgl_edit:false,tpgl_del:false},//图片管理
					biaoqGuanli:{bqgl_add:false,bqgl_edit:false,bqgl_del:false,bqgl_delAll:false,bqgl_export:false},//标签管理
					department:{bmgl_add:false,bmgl_edit:false,bmgl_del:false,bmgl_delAll:false,bmgl_export:false},//部门管理
					log:{czrz_search:false,czrz_export:false},//操作日志
					menu:{cdgl_add:false,cdgl_edit:false,cdgl_button:false,cdgl_switch:false,cdgl_del:false},//菜单管理
					
					liveManager:{zbgl_add:false,zbgl_edit:false,zbgl_del:false,zbgl_delAll:false,zbgl_export:false,zbgl_comment:false},//直播管理
					studyMap:{xxdt_add:false,xxdt_edit:false,xxdt_del:false,xxdt_delAll:false,xxdt_export:false,xxdt_comment:false,xxdt_tuijian:false},//学习地图
					knowSys:{zstx_add:false,zstx_edit:false,zstx_del:false,zstx_delAll:false,zstx_export:false},//知识体系分类
					dynamicManager:{dtgl_export:false,dtgl_del:false,dtgl_delAll:false},//动态管理
					topicManager:{htgl_list:false,htgl_hot:false,htgl_audit:false,htgl_export:false,htgl_del:false,htgl_delAll:false},//话题管理
                    topicClassify:{htfl_add:false,htfl_edit:false,htfl_del:false,htfl_delAll:false,htfl_export:false},//话题分类
					activityManager:{hdgl_export:false,hdgl_del:false,hdgl_delAll:false},//活动管理
					knowledgeMapCircle:{zzdt_map:false,zzdt_dynamic:false,zzdt_topic:false,zzdt_activity:false,zzdt_export:false,zzdt_cancel:false,zzdt_cancelAll:false},//广场--知识地图

					
					
					
                },
                liveManager:["zbgl_add","zbgl_edit","zbgl_del","zbgl_delAll","zbgl_export","zbgl_comment"],
                studyMap:["xxdt_add","xxdt_edit","xxdt_del","xxdt_delAll","xxdt_export","xxdt_comment","xxdt_tuijian"],
                knowSys:["zstx_add","zstx_edit","zstx_del","zstx_delAll","zstx_export"],
                dynamicManager:["dtgl_export","dtgl_del","dtgl_delAll"],
                topicManager:["htgl_list","htgl_hot","htgl_audit","htgl_export","htgl_del","htgl_delAll"],
                topicClassify:["htfl_add","htfl_edit","htfl_del","htfl_delAll","htfl_export"],

                activityManager:["hdgl_export","hdgl_del","hdgl_delAll"],
                knowledgeMapCircle:["zzdt_map","zzdt_dynamic","zzdt_topic","zzdt_activity","zzdt_export","zzdt_cancel","zzdt_cancelAll"],
                
                manager:["kcgl_add","kcgl_edit","kcgl_del","kcgl_comment","kcgl_delAll","kcgl_export"],
                tuijian:["kctj_add","kctj_cancel","kctj_cancelAll","kctj_export"],
                banner:["sygdt_add","sygdt_edit","sygdt_del"],
                news:["xwzx_add","xwzx_edit","xwzx_del","xwzx_comment","xwzx_delAll","xwzx_export"],
                lecture:["hdjz_add","hdjz_edit","hdjz_del","hdjz_delAll","hdjz_seen","hdjz_release","hdjz_bmgl","hdjz_export"],
                lectureRecommend:["hdjztj_recommend","hdjztj_cancel","hdjztj_export"],
                column:["lmgl_add","lmgl_edit","lmgl_del","lmgl_switch","lmgl_updown"],
                courseTaskManager:["kcrw_add","kcrw_release","kcrw_edit","kcrw_delAll","kcrw_del","kcrw_export","kcrw_seen"],
				teacher:["jsgl_add","jsgl_import","jsgl_edit","jsgl_del","jsgl_delAll","jsgl_export"],
				userManager:["yhgl_add","yhgl_edit","yhgl_del","yhgl_operationAll","yhgl_switch","yhgl_operationData"],
				enterprise:["qygl_add","qygl_export","qygl_edit","qygl_del","qygl_delAll"],
				audit:["ygsh_pass","ygsh_export","ygsh_fail"],
				goods:["spgl_add","spgl_edit","spgl_del","spgl_delAll","spgl_export"],
				goodRecommend:["tjgl_recommend","tjgl_cancel","tjgl_export"],
				exchange:["dhjl_seen","dhjl_del","dhjl_delivery","dhjl_logistics","dhjl_self","dhjl_export"],
				setAdmin:["glyqx_add","glyqx_switch","glyqx_edit","glyqx_reset","glyqx_del"],
				rank:["phb_kc","phb_js","phb_xy"],
				detail:["xfmx_export"],
				rule:["xfgz_edit"],
				grade:["xydj_add","xydj_edit","xydj_del","xydj_switch"],
				about:["gywm_save","gywm_cancel"],
				fankui:["yjfk_del","yjfk_delAll","yjfk_export"],
				version:["bbgl_add","bbgl_edit","bbgl_del","bbgl_release","bbgl_seen","bbgl_export"],
				xieyi:["yhxy_save","yhxy_cancel"],
				zhengce:["yszc_save","yszc_cancel"],
				tiaokuan:["fwtk_save","fwtk_cancel"],
				imgGuanli:["tpgl_add","tpgl_edit","tpgl_del"],
				biaoqGuanli:["bqgl_add","bqgl_edit","bqgl_del","bqgl_delAll","bqgl_export"],
				department:["bmgl_add","bmgl_edit","bmgl_del","bmgl_delAll","bmgl_export"],
				log:["czrz_search","czrz_export"],
				menu:["cdgl_add","cdgl_edit","cdgl_button","cdgl_switch","cdgl_del"],
                pePointCodeList:[]
            }
        },
        methods:{
            checkPermission(){
                //课程中心-按钮
               this.pePointCodeList.forEach(element => {
					//课程中心-按钮
                    if(this.manager.indexOf(element.code)>=0){             
                        this.huasan.manager[element.code]=true
                    }else if(this.tuijian.indexOf(element.code)>=0){             
                        this.huasan.tuijian[element.code]=true
                    }else if(this.banner.indexOf(element.code)>=0){             
                        this.huasan.banner[element.code]=true
                    }else if(this.news.indexOf(element.code)>=0){             
                        this.huasan.news[element.code]=true
                    }else if(this.lecture.indexOf(element.code)>=0){             
                        this.huasan.lecture[element.code]=true
                    }else if(this.lectureRecommend.indexOf(element.code)>=0){             
                        this.huasan.lectureRecommend[element.code]=true
                    }else if(this.column.indexOf(element.code)>=0){             
                        this.huasan.column[element.code]=true
                    }else if(this.courseTaskManager.indexOf(element.code)>=0){   
//                  	平台必修课
                        this.huasan.courseTaskManager[element.code]=true
                    }else if(this.teacher.indexOf(element.code)>=0){   
                        this.huasan.teacher[element.code]=true
                    }else if(this.userManager.indexOf(element.code)>=0){   
                        this.huasan.userManager[element.code]=true
                    }else if(this.enterprise.indexOf(element.code)>=0){   
                        this.huasan.enterprise[element.code]=true
                    }else if(this.audit.indexOf(element.code)>=0){   
                        this.huasan.audit[element.code]=true
                    }else if(this.goods.indexOf(element.code)>=0){   
                        this.huasan.goods[element.code]=true
                    }else if(this.goodRecommend.indexOf(element.code)>=0){   
                        this.huasan.goodRecommend[element.code]=true
                    }else if(this.exchange.indexOf(element.code)>=0){   
                        this.huasan.exchange[element.code]=true
                    }else if(this.setAdmin.indexOf(element.code)>=0){   
                        this.huasan.setAdmin[element.code]=true
                    }else if(this.rank.indexOf(element.code)>=0){   
                        this.huasan.rank[element.code]=true
                    }else if(this.detail.indexOf(element.code)>=0){   
                        this.huasan.detail[element.code]=true
                    }else if(this.rule.indexOf(element.code)>=0){   
                        this.huasan.rule[element.code]=true
                    }else if(this.grade.indexOf(element.code)>=0){   
                        this.huasan.grade[element.code]=true
                    }else if(this.about.indexOf(element.code)>=0){   
                        this.huasan.about[element.code]=true
                    }else if(this.fankui.indexOf(element.code)>=0){   
                        this.huasan.fankui[element.code]=true
                    }else if(this.version.indexOf(element.code)>=0){   
                        this.huasan.version[element.code]=true
                    }else if(this.xieyi.indexOf(element.code)>=0){   
                        this.huasan.xieyi[element.code]=true
                    }else if(this.zhengce.indexOf(element.code)>=0){   
                        this.huasan.zhengce[element.code]=true
                    }else if(this.tiaokuan.indexOf(element.code)>=0){   
                        this.huasan.tiaokuan[element.code]=true
                    }else if(this.imgGuanli.indexOf(element.code)>=0){   
                        this.huasan.imgGuanli[element.code]=true
                    }else if(this.biaoqGuanli.indexOf(element.code)>=0){   
                        this.huasan.biaoqGuanli[element.code]=true
                    }else if(this.department.indexOf(element.code)>=0){   
                        this.huasan.department[element.code]=true
                    }else if(this.log.indexOf(element.code)>=0){   
                        this.huasan.log[element.code]=true
                    }else if(this.menu.indexOf(element.code)>=0){   
                        this.huasan.menu[element.code]=true
                    }else if(this.liveManager.indexOf(element.code)>=0){ 
                    	//直播管理
                        this.huasan.liveManager[element.code]=true
                    }else if(this.studyMap.indexOf(element.code)>=0){ 
                        this.huasan.studyMap[element.code]=true
                    }else if(this.knowSys.indexOf(element.code)>=0){ 
                        this.huasan.knowSys[element.code]=true
                    }else if(this.dynamicManager.indexOf(element.code)>=0){ 
                        this.huasan.dynamicManager[element.code]=true
                    }else if(this.topicManager.indexOf(element.code)>=0){ 
                        this.huasan.topicManager[element.code]=true
                    }else if(this.topicClassify.indexOf(element.code)>=0){ 
                        this.huasan.topicClassify[element.code]=true
                    }else if(this.activityManager.indexOf(element.code)>=0){ 
                        this.huasan.activityManager[element.code]=true
                    }else if(this.knowledgeMapCircle.indexOf(element.code)>=0){ 
                        this.huasan.knowledgeMapCircle[element.code]=true
                    }
                });
                //console.log("权限",this.huasan)
                this.$root.huasan=this.huasan                
            }
        },
        mounted: function(){ 
        	if(this.$root.userInfoMsg!=null){
        		// this.pointApiSet=["kcgl_add","kcgl_updata","kcgl_del","kcgl_comment"];
	            this.pePointCodeList=this.$root.userInfoMsg.pePointCodeList;
	            this.checkPermission();
        	}
        }
    }
</script>